package com.test;

import java.awt.*;

public class SingletonFonts {
	
	 /* 私有构造方法，防止被实例化 */  
    private SingletonFonts() {  
    }  
  
    /* 此处使用一个内部类来维护单例 */  
    private static class SingletonFSFactory {  
        private static Font instance = FontUtil.getFont("fansong_gb2312.ttf",Font.BOLD,48f);
    }  
    
    private static class SingletonHWXWFactory {  
        private static Font instance = FontUtil.getFont("huawenxinwei.ttf",Font.BOLD,51f);//24f
    } 
    
    private static class SingletonKTFactory {  
        private static Font instance = FontUtil.getFont("kaiti_gb2312.ttf",Font.BOLD,48f);//22f
    } 
  
    /* 获取实例 */  
    public static Font getFanSongInstance() {  
        return SingletonFSFactory.instance;  
    }  
    public static Font getHuaWenXinWeiInstance() {  
        return SingletonHWXWFactory.instance;  
    } 
    public static Font getKaiTiInstance() {  
        return SingletonKTFactory.instance;  
    } 
  
	
	
}
